import { ServiceProto } from 'tsrpc-proto';
import { MsgSyncServerInfo } from './MsgSyncServerInfo';
import { ReqJoinCluster, ResJoinCluster } from './PtlJoinCluster';

export interface ServiceType {
    api: {
        "JoinCluster": {
            req: ReqJoinCluster,
            res: ResJoinCluster
        }
    },
    msg: {
        "SyncServerInfo": MsgSyncServerInfo
    }
}

export const serviceProto: ServiceProto<ServiceType> = {
    "version": 1,
    "services": [
        {
            "id": 1,
            "name": "SyncServerInfo",
            "type": "msg"
        },
        {
            "id": 0,
            "name": "JoinCluster",
            "type": "api"
        }
    ],
    "types": {
        "MsgSyncServerInfo/MsgSyncServerInfo": {
            "type": "Interface",
            "properties": [
                {
                    "id": 0,
                    "name": "serverInfo",
                    "type": {
                        "type": "Reference",
                        "target": "../../gateClient/GameServer/IGameServerInfo"
                    }
                }
            ]
        },
        "../../gateClient/GameServer/IGameServerInfo": {
            "type": "Interface",
            "properties": [
                {
                    "id": 0,
                    "name": "serverId",
                    "type": {
                        "type": "String"
                    }
                },
                {
                    "id": 1,
                    "name": "serverName",
                    "type": {
                        "type": "String"
                    }
                },
                {
                    "id": 2,
                    "name": "serverWSUrl",
                    "type": {
                        "type": "String"
                    }
                },
                {
                    "id": 3,
                    "name": "clientCount",
                    "type": {
                        "type": "Number"
                    }
                },
                {
                    "id": 4,
                    "name": "extendData",
                    "type": {
                        "type": "Any"
                    },
                    "optional": true
                }
            ]
        },
        "PtlJoinCluster/ReqJoinCluster": {
            "type": "Interface",
            "properties": [
                {
                    "id": 0,
                    "name": "serverInfo",
                    "type": {
                        "type": "Reference",
                        "target": "../../gateClient/GameServer/IGameServerInfo"
                    }
                },
                {
                    "id": 1,
                    "name": "clusterKey",
                    "type": {
                        "type": "String"
                    }
                }
            ]
        },
        "PtlJoinCluster/ResJoinCluster": {
            "type": "Interface"
        }
    }
};